﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StarryEdge.WPF.Attributes
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = false)]
    public class UIPropertyAttribute : Attribute
    {
        /// <summary>
        /// 显示的名字
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 需要绑定的集合属性名
        /// </summary>
        public Type CollectionName { get; set; }
        /// <summary>
        /// 后缀显示，为空不显示
        /// </summary>
        public string Suffix { get; set; }
        public int LayerNumber { get; set; }
        public string[] MyExpression { get; set; }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="name">显示名字</param>
        /// <param name="suffix">后缀显示</param>
        /// <param name="isSingleLine">是否单独一行，默认不是</param>
        /// <param name="collectionName">需要绑定的枚举的类型</param>
        /// <param name="myExpression">枚举过滤不显示,第一个参数不包含为真,第二个参数为包含为真,往后为不等于则显示</param>
        public UIPropertyAttribute(string name, string suffix = "", int layer = 2, Type collectionName = default, string[] myExpression = default)
        {
            Name = name;
            Suffix = suffix;
            LayerNumber = layer;
            CollectionName = collectionName;
            MyExpression = myExpression;
        }
    }
}
